package com.example.wechatlistview.pages;

import androidx.annotation.DrawableRes;
import androidx.appcompat.app.AppCompatActivity;

import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.widget.ImageButton;
import android.widget.ImageView;

import com.example.wechatlistview.R;
import com.example.wechatlistview.events.strategys.ClickStrategy;
import com.example.wechatlistview.resmanager.itemType;
import com.example.wechatlistview.events.controllers.ClickController;

public class pg_moments extends AppCompatActivity {

    ImageButton btn_back;
    ImageView card2Img;
    ImageView card3Img;


    @DrawableRes
    int card2Id = R.drawable.moments_img1;
    int card3Id = R.drawable.moments_img2;


    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_pg_moments);
        btn_back = (ImageButton) findViewById(R.id.moments_back);
        card2Img = (ImageView) findViewById(R.id.moments_card2_content);
        card3Img = (ImageView) findViewById(R.id.moments_card3_content);

        card2Img.setTag(card2Id);
        card3Img.setTag(card3Id);

        card2Img.setOnClickListener(clickListener);
        card3Img.setOnClickListener(clickListener);
        btn_back.setOnClickListener(new ClickController.BtnBuilder(pg_moments.this, ClickStrategy.BtnStratgy.BACK));

    }


    View.OnClickListener clickListener = new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            int id = (int) v.getTag();
            Intent intent = new Intent(pg_moments.this, pg_viewer.class);
            Bundle bundle = new Bundle();
            bundle.putInt("imgRes", id);
            intent.putExtras(bundle);
            startActivity(intent);

        }
    };


}